package la.iok.hzsvn.lewin.movie.shopmovie.mapper;

import la.iok.hzsvn.lewin.movie.shopmovie.entity.PlayerFee;
import la.iok.hzsvn.lewin.mybatis.mapper.BaseMapper;
import la.iok.hzsvn.share.annotations.NotNull;

public interface PlayerFeeMapper extends BaseMapper<PlayerFee> {
    int updateAmount(PlayerFee entity);

    int confirmPaid(PlayerFee playerFee);

    /**
     * 取消支付。将状态修改为未支付
     * @param playerFee 玩家收费项。id和版本需要有值
     * @return 应该为1
     */
    int cancelPayment(@NotNull PlayerFee playerFee);

    /**
     * 查询玩家的剧本费
     * @param playerId 玩家id
     * @return 剧本费对象
     */
    PlayerFee selectMovieFee(@NotNull Long playerId);

    /**
     * 增加抵扣金额
     * @param id 费用项id
     * @param amount 抵扣金额,单位分
     * @param version 费用项当前版本
     * @return 修改的记录数，应该为1
     */
    int addCouponDeductionAmount(Long id, int amount, Long version);

    int setCouponDeductionAmount(Long id, int amount, Long version);
}
